package org.example.utils;

import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.FileSystem;

import java.io.IOException;
import org.apache.hadoop.fs.Path;

/**
 * TODO
 *
 * @Version 1.0.0
 * @Date 2023/12/6 22:06
 * @Author liangfengyuan1024@gmail.com
 */
public class MpUtil {
    public static void delOutPut(Configuration config, Path... outPaths) throws IOException {
        FileSystem fs = FileSystem.get(config);
        // 如果文件存在就将其删除
        for (Path p : outPaths) {
            if (fs.exists(p)) {
                fs.delete(p, true);
            }
        }
    }
}

